package com.ruoyi.dwzzzy.utils;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description :
 * @auther :   zhanvie
 * @Date :   2021-03-21
 */
public class Main {

//    public static GraphNode findNeighbour(GraphNode nodes, List<GraphLink> edges) {
//        List<GraphLink> links = edges.parallelStream().filter(item -> item.getFrom() == nodes.getId())
//                .collect(Collectors.toList());
//
//    }

    public static void main(String[] args) {
        List<GraphNode> nodes = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            GraphNode n = new GraphNode();
            n.setId(++i);
            n.setName("节点" + i);
            nodes.add(n);
        }

        List<GraphLink> edges = new ArrayList<>();
        GraphLink l1 = new GraphLink();
        l1.setFrom(5);
        l1.setTo(3);
        edges.add(l1);
        GraphLink l2 = new GraphLink();
        l2.setFrom(8);
        l2.setTo(3);
        edges.add(l2);
        GraphLink l3 = new GraphLink();
        l3.setFrom(3);
        l3.setTo(2);
        edges.add(l3);
        GraphLink l4 = new GraphLink();
        l4.setFrom(1);
        l4.setTo(2);
        edges.add(l4);
        GraphLink l5 = new GraphLink();
        l5.setFrom(2);
        l5.setTo(4);
        edges.add(l5);
        GraphLink l6 = new GraphLink();
        l6.setFrom(4);
        l6.setTo(9);
        edges.add(l6);
        GraphLink l7 = new GraphLink();
        l7.setFrom(4);
        l7.setTo(6);
        edges.add(l7);
        GraphLink l8 = new GraphLink();
        l8.setFrom(6);
        l8.setTo(7);
        edges.add(l8);
        GraphLink l9 = new GraphLink();
        l9.setFrom(6);
        l9.setTo(10);
        edges.add(l9);

    }

}
